<?php
if ($text->num_rows() > 0) {
    $t = $text->row();
}

$image_path = './assets/text_img/images/' . $t->image;
if ($t->image != '') {
    if (file_exists($image_path)) {
        $image_path = base_url() . '/assets/text_img/images/' . $t->image;
    } else {
        $image_path = root_url('seatting-falin') . 'assets/noimage.gif';
    }
} else {
    $image_path = root_url('seatting-falin') . 'assets/noimage.gif';
}
?>

<div id="wrapper-content">
      <table class="titrepage" width="100%">
        <tr>
            <td > Modifier</td>
 
        </tr>
    </table>
   
        <?php echo form_open_multipart(site_url('seatting_admin/edit_text') . '/' . $t->id); ?>
        <table width="100%" class="list" cellpadding="10px" cellspacing="0">
            <tr>
                <td>Titre:</td>
                <td><input type="text" value="<?php echo $t->title; ?>" size="40" name="title"></td>
            </tr>
            <tr>
                <td>Image:</td>
                <td><img src="<?php echo $image_path;?>" height="60"/><input type="file" name="userfile" id="userfile" size="25"/></td>
            </tr>
            <tr>
                <td>Contenu:</td>
                <td colspan="2">
                    <?php
                    $data = array('name' => 'content',
                        'id' => 'content',
                        'width' => '610',
                        'height' => '250',
                        'value' => $t->content,
                        'type' =>'text'
                    );
                    echo form_fckeditor($data);
                    ?>
                </td>
            </tr>
            <tr>
                <td><td colspan="2"><?php echo form_error('title'); ?></td>
                <td colspan="2"><?php echo form_error('content'); ?></td>
            </tr>
            <tr>
                <td><input type="submit" name="submit" value=" Modifier "/></td>
            </tr>
        </table>

    <?php echo form_close() ?>

</div>

